<template>
    <div>
        component2
        name:{{name}}
        <a-input v-model:value="text"></a-input>
        <a-button @click="emitEvent">submit</a-button>
    </div>
</template>

<script>
export default {
    name: "component2",
    emits: [ 'submit'],
    props:{
        name:{
            type:String
        }
    },
    data(){
        return {
            text:""
        }
    },
    methods:{
        emitEvent(){
            this.$emit('submit',this.text);
        }
    }
}
</script>

<style scoped>

</style>
